#ifndef _OC_Main_FDB_File_H__
#define _OC_Main_FDB_File_H__

#include "OCMain/FileUtil.h"

namespace OCPP
{
	class FDBFile
	{
	public:
		FDBFile(String name);
		~FDBFile(void);

		void open();
		void openForWrite();
		MemoryDataStreamPtr read(size_t b,size_t e);
		bool write(char* ptr, size_t e);
		size_t tellp() { return mP; }
	private:
		bool					mW;
		size_t					mP;
		String					mName;
		std::ofstream			mWriteStream;
		std::ofstream			mWriteCacheStream;
		std::vector<size_t>		mIfsCapacityList;
		std::vector<std::ifstream*>	mIfsList;
	};
}


#endif
